/*
 * 文件名： LimitValueData.java
 * 
 * 创建日期： 2016年12月1日
 *
 * Copyright(C) 2016, by <a href="mailto:liws@xingyuanauto.com">liws</a>.
 *
 * 原始作者: liws
 *
 */
package com.moli.iov.protocol.model.realtime;

import java.io.Serializable;

import com.moli.iov.protocol.codec.DataEncoder;
import com.moli.iov.protocol.codec.Serialize;
import com.moli.iov.protocol.model.EntityBytesLen;
import com.moli.iov.util.ByteArrayUtil;


/**
 * 极值数据
 *
 * @author <a href="mailto:liws@xingyuanauto.com">liws</a>
 *
 * @version $Revision$
 *
 * @since 2016年12月1日
 */
@Serialize(unit="byte",isBigEndian=true)
public class LimitValueReq implements Serializable,EntityBytesLen{

	 /** 
	 */ 
	public static final long serialVersionUID = 1L;


	 /**
	 *
	 */
	@Override
	public int getBytesLen() {
		return 14;
	}
	
	/**
	 * 最高电压电池子系统号
	 */
	@Serialize(unit="byte",offset=0,size=1,min=1,max=250)
	public short highestCellSysCode;
	
	/**
	 * 最高电压电池单体代号
	 */
	@Serialize(unit="byte",offset=1,size=1,min=1,max=250)
	public short highestCellSingleCode;
	
	/**
	 * 电池单体电压最高值
	 * 最小计量单元 0.001V
	 */
	@Serialize(unit="byte",offset=2,size=2,min=0,max=15000,coefficient=0.001,precision=3)
	public double cellHighestVoltage;
	
	/**
	 * 最低电压电池子系统号
	 * 
	 */
	@Serialize(unit="byte",offset=4,size=1,min=1,max=250)
	public short lowestCellSysCode;
	
	
	/**
	 * 最低电压电池单体代号
	 * 
	 */
	@Serialize(unit="byte",offset=5,size=1,min=1,max=250)
	public short lowestCellSingleCode;
	
	/**
	 * 电池单体电压最低值
	 */
	@Serialize(unit="byte",offset=6,size=2,min=0,max=15000,coefficient=0.001,precision=3)
	public double cellLowestVoltage;
	

	/**
	 * 最高温度子系统号
	 */
	@Serialize(unit="byte",offset=8,size=1,min=1,max=250)
	public short highestTemperatureSysCode;
	
	/**
	 * 最高温度探针序号
	 */
	@Serialize(unit="byte",offset=9,size=1,min=1,max=250)
	public short highestTemperatureProbeNum;
	
	/**
	 * 最高温度值
	 */
	@Serialize(unit="byte",offset=10,size=1,valOffset=40,min=0,max=250)
	public short highestTemperature;
	
	/**
	 * 最低温度子系统号
	 */
	@Serialize(unit="byte",offset=11,size=1,min=1,max=250)
	public short lowestTemperatureSysCode;
	
	/**
	 * 最低温度探针序号
	 */
	@Serialize(unit="byte",offset=12,size=1,min=1,max=250)
	public short lowestTemperatureProbeNum;
	
	/**
	 * 最低温度值
	 */
	@Serialize(unit="byte",offset=13,size=1,valOffset=40,min=0,max=250)
	public short lowestTemperature;

	 /**
	*
	* @return the highestCellSysCode
	*/
	
	public short getHighestCellSysCode() {
		return highestCellSysCode;
	}

	/**
	*
	* @param highestCellSysCode the highestCellSysCode to set
	*/
	public void setHighestCellSysCode(short highestCellSysCode) {
		this.highestCellSysCode = highestCellSysCode;
	}

	/**
	*
	* @return the highestCellSingleCode
	*/
	
	public short getHighestCellSingleCode() {
		return highestCellSingleCode;
	}

	/**
	*
	* @param highestCellSingleCode the highestCellSingleCode to set
	*/
	public void setHighestCellSingleCode(short highestCellSingleCode) {
		this.highestCellSingleCode = highestCellSingleCode;
	}

	/**
	*
	* @return the cellHighestVoltage
	*/
	
	public double getCellHighestVoltage() {
		return cellHighestVoltage;
	}

	/**
	*
	* @param cellHighestVoltage the cellHighestVoltage to set
	*/
	public void setCellHighestVoltage(double cellHighestVoltage) {
		this.cellHighestVoltage = cellHighestVoltage;
	}

	/**
	*
	* @return the lowestCellSysCode
	*/
	
	public short getLowestCellSysCode() {
		return lowestCellSysCode;
	}

	/**
	*
	* @param lowestCellSysCode the lowestCellSysCode to set
	*/
	public void setLowestCellSysCode(short lowestCellSysCode) {
		this.lowestCellSysCode = lowestCellSysCode;
	}

	/**
	*
	* @return the lowestCellSingleCode
	*/
	
	public short getLowestCellSingleCode() {
		return lowestCellSingleCode;
	}

	/**
	*
	* @param lowestCellSingleCode the lowestCellSingleCode to set
	*/
	public void setLowestCellSingleCode(short lowestCellSingleCode) {
		this.lowestCellSingleCode = lowestCellSingleCode;
	}

	/**
	*
	* @return the cellLowestVoltage
	*/
	
	public double getCellLowestVoltage() {
		return cellLowestVoltage;
	}

	/**
	*
	* @param cellLowestVoltage the cellLowestVoltage to set
	*/
	public void setCellLowestVoltage(double cellLowestVoltage) {
		this.cellLowestVoltage = cellLowestVoltage;
	}

	/**
	*
	* @return the highestTemperatureSysCode
	*/
	
	public short getHighestTemperatureSysCode() {
		return highestTemperatureSysCode;
	}

	/**
	*
	* @param highestTemperatureSysCode the highestTemperatureSysCode to set
	*/
	public void setHighestTemperatureSysCode(short highestTemperatureSysCode) {
		this.highestTemperatureSysCode = highestTemperatureSysCode;
	}

	/**
	*
	* @return the highestTemperatureProbeNum
	*/
	
	public short getHighestTemperatureProbeNum() {
		return highestTemperatureProbeNum;
	}

	/**
	*
	* @param highestTemperatureProbeNum the highestTemperatureProbeNum to set
	*/
	public void setHighestTemperatureProbeNum(short highestTemperatureProbeNum) {
		this.highestTemperatureProbeNum = highestTemperatureProbeNum;
	}

	/**
	*
	* @return the highestTemperature
	*/
	
	public short getHighestTemperature() {
		return highestTemperature;
	}

	/**
	*
	* @param highestTemperature the highestTemperature to set
	*/
	public void setHighestTemperature(short highestTemperature) {
		this.highestTemperature = highestTemperature;
	}

	/**
	*
	* @return the lowestTemperatureSysCode
	*/
	
	public short getLowestTemperatureSysCode() {
		return lowestTemperatureSysCode;
	}

	/**
	*
	* @param lowestTemperatureSysCode the lowestTemperatureSysCode to set
	*/
	public void setLowestTemperatureSysCode(short lowestTemperatureSysCode) {
		this.lowestTemperatureSysCode = lowestTemperatureSysCode;
	}

	/**
	*
	* @return the lowestTemperatureProbeNum
	*/
	
	public short getLowestTemperatureProbeNum() {
		return lowestTemperatureProbeNum;
	}

	/**
	*
	* @param lowestTemperatureProbeNum the lowestTemperatureProbeNum to set
	*/
	public void setLowestTemperatureProbeNum(short lowestTemperatureProbeNum) {
		this.lowestTemperatureProbeNum = lowestTemperatureProbeNum;
	}

	/**
	*
	* @return the lowestTemperature
	*/
	
	public short getLowestTemperature() {
		return lowestTemperature;
	}

	/**
	*
	* @param lowestTemperature the lowestTemperature to set
	*/
	public void setLowestTemperature(short lowestTemperature) {
		this.lowestTemperature = lowestTemperature;
	}

	/**
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("LimitValueReq [highestCellSysCode=");
		builder.append(highestCellSysCode);
		builder.append(", highestCellSingleCode=");
		builder.append(highestCellSingleCode);
		builder.append(", cellHighestVoltage=");
		builder.append(cellHighestVoltage);
		builder.append(", lowestCellSysCode=");
		builder.append(lowestCellSysCode);
		builder.append(", lowestCellSingleCode=");
		builder.append(lowestCellSingleCode);
		builder.append(", cellLowestVoltage=");
		builder.append(cellLowestVoltage);
		builder.append(", highestTemperatureSysCode=");
		builder.append(highestTemperatureSysCode);
		builder.append(", highestTemperatureProbeNum=");
		builder.append(highestTemperatureProbeNum);
		builder.append(", highestTemperature=");
		builder.append(highestTemperature);
		builder.append(", lowestTemperatureSysCode=");
		builder.append(lowestTemperatureSysCode);
		builder.append(", lowestTemperatureProbeNum=");
		builder.append(lowestTemperatureProbeNum);
		builder.append(", lowestTemperature=");
		builder.append(lowestTemperature);
		builder.append("]");
		return builder.toString();
	}

	public static void main(String[] args) {
		LimitValueReq limit = new LimitValueReq();
		limit.setHighestCellSysCode((byte)123);
		limit.setHighestCellSingleCode((byte)23);
		limit.setCellHighestVoltage((short)14000);
		limit.setLowestCellSysCode((byte)110);
		limit.setLowestCellSingleCode((byte)10);
		limit.setCellLowestVoltage((short)1000);
		limit.setHighestTemperatureSysCode((byte)120);
		limit.setHighestTemperatureProbeNum((byte)12);
		limit.setHighestTemperature((byte)160);
		limit.setLowestTemperatureSysCode((byte)99);
		limit.setLowestTemperatureProbeNum((byte)88);
		limit.setLowestTemperature((byte)18);
		
		DataEncoder<LimitValueReq> encoder = new DataEncoder<LimitValueReq>();
		byte[] bytes;
		try {
			bytes = encoder.encode(limit);
			System.out.println(ByteArrayUtil.toHexString(bytes));
		}
		catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
